{extend name="common/base" /}
{block name="body"}
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <ul class="layui-tab-title">
        <a href="{:url('globalConfig',['type'=>1])}"><li {eq name="intype" value="1" } class="layui-this" {/eq}>基本配置</li></a>
        <a href="{:url('globalConfig',['type'=>2])}"><li {eq name="intype" value="2" } class="layui-this" {/eq}>模板配置</li></a>

    </ul>
    <div class="layui-tab-content">
        {switch name="intype"}
        {case value="1"}
        <div class="layui-tab-item  layui-show">
            <form class="layui-form" action="" style="padding-right: 10px;">

                {volist name="configList" id="val"}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width: 200px;">{$val.name}</label>
                    <div class="layui-input-block" style="margin-left: 230px;">
                        <input type="text" name="{$val.code}"  value="{$val.value}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                {/volist}

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="ADM">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
        {/case}
        {case value="2"}
        <div class="layui-tab-item  layui-show">
            <form class="layui-form" action="" style="padding-right: 10px;">

                {volist name="configList" id="val"}
                {if condition="$val.code == 'templet_style'"}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width: 80px;">{$val.name}</label>
                    <div class="layui-input-block" style="margin-left: 110px;">
                        {volist name="style_list" id="vo"}
                        <input type="radio" name="{$val.code}" title="{$vo.name}" class="select-style" value="{$vo.code}" {if condition="$val.value == $vo.code"}checked{/if}>
                        {/volist}

                    </div>
                </div>
                {else/}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width: 200px;">{$val.name}</label>
                    <div class="layui-input-block" style="margin-left: 230px;">
                        <input type="text" name="{$val.code}"  value="{$val.value}" autocomplete="off" class="layui-input">
                    </div>
                </div>
                {/if}
                {/volist}

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="ADM">立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
        {/case}
        {/switch}
    </div>
</div>

<script>
    layui.use('form', function(){
        var form = layui.form;
        form.on('submit(ADM)', function(data){
            $.post('',data.field,function (res) {
                layer.msg(res.msg);
                location.reload();
            });
            return false;
        });
    });

</script>
{/block}